package com.gxa.educate.core.utils;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.util.List;

public class PageUtils {
    public static PageInfo startPage(Integer page, Integer offset, IService service){
        PageHelper.startPage(page,offset);
        PageInfo info = new PageInfo<>(service.list());
        return  info;
    }
    public static Long getTotal(PageInfo info){
        return info.getTotal();
    }
    public static List getList(PageInfo info){
        return  info.getList();
    }
}
